

import 'dart:isolate';

void main(){
  print("main begin");
  Isolate.spawn((message) {
    print("匿名函数线程：$message");
  }, "inner msg...");

  Isolate.spawn(newThread1, "hello 1");
  Isolate.spawn(newThread2, "hello 2");
  Isolate.spawn(newThread3, "hello 3");

  print("main end");
}


void newThread1(String msg){
  print("Thread 1 msg:$msg");
}

void newThread2(String msg){
  print("Thread 2 msg:$msg");
}

void newThread3(String msg){
  print("Thread 3 msg:$msg");
}

